/**
 * 封装用户请求模块
 */
import request from '@/utils/request.js'
// import store from '@/store'
/**
 * 发送登录请求
 * @param {*} data
 */

export const login = data => {
  return request({
    method: 'POST',
    url: '/app/v1_0/authorizations',
    data
  })
}
/**
 *
 * @param {*} mobile
 */
export const getCode = mobile => {
  return request({
    method: 'GET',
    url: '/app/v1_0/sms/codes/' + mobile
  })
}

export const getUserInfo = () => {
  return request({
    method: 'GET',
    url: '/app/v1_0/user'
    // headers: {
    //   Authorization: 'Bearer ' + store.state.user.token
    // }
  })
}

export const getUserChannels = () => {
  return request({
    method: 'GET',
    url: '/app/v1_0/user/channels'
  })
}
